"""
类名：LoginAPI
类属性：login_url：保存登陆的url，"http://ihrm-test.itheima.net/api/sys/login"
类方法：
    def login(cls, body)：
        # 功能：发送登陆请求
        # :param body: 发送请求的请求体
        # :return: 发送登陆请求后的响应对象
"""

import requests

from config import BASE_URL


class LoginAPI(object):

    login_url = BASE_URL + "/api/sys/login"

    @classmethod
    def login2(cls, mobile, password):
        """发送登录请求"""
        body = {"mobile": mobile,
                "password": password}
        conn = requests.post(cls.login_url, json=body)
        return conn

    @classmethod
    def login(cls, body):
        """发送登录请求"""
        conn = requests.post(cls.login_url, json=body)
        return conn



